package com.hkts.reportform.purchasepound.controller;

import com.hkts.reportform.purchasepound.service.PurchasePoundService;
import com.hkts.reportform.utils.CustomPage;
import com.hkts.reportform.utils.ErpProperties;
import com.hkts.reportform.utils.Result;
import com.hkts.reportform.utils.ResultUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.text.ParseException;
import java.util.List;
import java.util.Map;

/**
 * @ClassNamePurchasePoundController
 * @Description  采购磅单部分业务
 * @Author yck
 * @Date2020-11-27 9:30
 * @Version V1.0
 **/
@Controller
@RequestMapping("/erp/purchasePound")
public class PurchasePoundController {
    @Autowired
    private PurchasePoundService purchasePoundDaoImp;

    @RequestMapping("/purchasePoundCurrentDay")
    @ResponseBody
    public Result<Object> purchasePoundCurrentDay() {
     Map map=   purchasePoundDaoImp.purchasePoundCurrentDay();
        return ResultUtil.data(map);
    }
    //磅单变动趋势
    @RequestMapping("/purchasePoundTrend")
    @ResponseBody
    public Result<Object> purchasePoundTrend(String dateType, String beginDate, String endDate) throws ParseException {
        Map map=   purchasePoundDaoImp.purchasePoundTrend(dateType,beginDate,endDate);
        return ResultUtil.data(map);
    }
    //磅单分页
    @RequestMapping("/purchasePoundPage")
    @ResponseBody
    public Result<Object> purchasePoundPage(String dateType, String beginDate, String endDate,CustomPage page) throws ParseException {
        CustomPage pageData=   purchasePoundDaoImp.purchasePoundPage(dateType,beginDate,endDate,page);
        return ResultUtil.data(pageData);
    }
}
